﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LearningCompany_DAO;
using System.Security.Principal;

namespace LearningCompany
{
    public partial class Layout : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            IPrincipal oUser;
            Commercial oCommercial;

            oUser = HttpContext.Current.User;
            
            LblIdentiteUtilisateur.Visible = false;
            DivInfosUtilisateur.Visible = oUser.Identity.IsAuthenticated;

            if (DivInfosUtilisateur.Visible)
            {
                oCommercial = Commercial.GetInstance(oUser.Identity.Name);
                LblIdentiteUtilisateur.Text = oCommercial.NomPrenom;
            }

        }
    }
}